#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<deque>
#include<algorithm>
using namespace std;

void Print(const deque<int> d)
{
	for (deque<int>::const_iterator it = d.begin(); it != d.end(); it++)
	{
		cout << *it << " ";
	}
	cout << endl;
}

void test()
{
	deque<int> d;
	d.push_back(3);
	d.push_back(2);
	d.push_back(5);
	d.push_back(1);
	Print(d);

	sort(d.begin(), d.end());
	Print(d);
}

int main()
{
	test();

	return 0;
}